package vip.xiaomaoxiaoke.mybatisplusmax;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.Collection;
import java.util.List;


public interface MyBatisPlusMax<T> {

   /**
    * 等值查询
    * */
    default MyBatisPlusMax<T> eq(SFunction<T,?> function, Object val) {
        return this.eq(null,function,val);
    }



    /**
     * 等值查询
     * */
    MyBatisPlusMax<T> eq(Boolean flag, SFunction<T,?> function, Object val) ;

    default MyBatisPlusMax<T> between(SFunction<T,?> function, Object val1, Object val2) {
        return this.between(null,function,val1,2);
    }

    MyBatisPlusMax<T> between(Boolean flag, SFunction<T,?> function, Object val1, Object val2);

    default MyBatisPlusMax<T> notBetween(SFunction<T,?> function, Object val1, Object val2) {
        return this.notBetween(null,function,val1,2);
    }

    MyBatisPlusMax<T> notBetween(Boolean flag, SFunction<T,?> function, Object val1, Object val2);

    default MyBatisPlusMax<T> in(SFunction<T,?> function, List<Object> val) {
        return this.in(null,function,val);
    }

    MyBatisPlusMax<T> notIn(Boolean flag, SFunction<T,?> function, Collection<?> values) ;

    default MyBatisPlusMax<T> notIn(SFunction<T,?> function, List<Object> val) {
        return this.notIn(null,function,val);
    }

    MyBatisPlusMax<T> in(Boolean flag, SFunction<T,?> function, Collection<?> values) ;

    default MyBatisPlusMax<T> last(String lastSqls) {
        return this.last(null,lastSqls);
    }


    MyBatisPlusMax<T> last(Boolean condition, String lastSqls) ;


    default MyBatisPlusMax<T> isNotNull(SFunction<T,?> function) {
        return this.isNotNull(true,function);
    }
    MyBatisPlusMax<T> isNotNull(Boolean condition, SFunction<T,?> function);


    default MyBatisPlusMax<T> isNull(SFunction<T,?> function) {
        return this.isNull(null,function);
    }

    MyBatisPlusMax<T> isNull(Boolean condition, SFunction<T,?> function);


    default MyBatisPlusMax<T> like(SFunction<T,?> function, Object val) {
        return this.like(null,function,val);
    }

    MyBatisPlusMax<T> like(Boolean condition, SFunction<T,?> function, Object val);

    default MyBatisPlusMax<T> likeLeft(SFunction<T,?> function, Object val) {
        return this.likeLeft(null,function,val);
    }

    MyBatisPlusMax<T> likeLeft(Boolean condition, SFunction<T,?> function, Object val);

    default MyBatisPlusMax<T> likeRight(SFunction<T,?> function, Object val) {
        return this.likeRight(function,val);
    }

    MyBatisPlusMax<T> likeRight(Boolean condition, SFunction<T,?> function, Object val);

    default MyBatisPlusMax<T> or() {
        return this.or(true);
    }


    default MyBatisPlusMax<T> ne(SFunction<T,?> function, Object val) {
        return this.ne(null,function,val);
    }
    MyBatisPlusMax<T> ne(Boolean flag, SFunction<T,?> function, Object val) ;


    default MyBatisPlusMax<T> gt(SFunction<T,?> function, Object val) {
        return this.gt(null,function,val);
    }
    MyBatisPlusMax<T> gt(Boolean flag, SFunction<T,?> function, Object val);

    default MyBatisPlusMax<T> orderByDesc (SFunction<T,?> function) {
        return this.orderByDesc(true,function);
    }

    default MyBatisPlusMax<T> groupBy (SFunction<T,?> function) {
        return this.groupBy(true,function);
    }
    MyBatisPlusMax<T> groupBy (Boolean flag, SFunction<T,?> function);

    MyBatisPlusMax<T> orderByAsc (Boolean flag, SFunction<T,?> function);


    default MyBatisPlusMax<T> orderByAsc (SFunction<T,?> function) {
        return this.orderByAsc(true,function);
    }
    MyBatisPlusMax<T> orderByDesc (Boolean flag, SFunction<T,?> function);
    MyBatisPlusMax<T> or(Boolean condition);

    default MyBatisPlusMax<T> ge(SFunction<T, ?> function, Object val) {
        return this.ge(null,function,val);
    }

    MyBatisPlusMax<T> ge(Boolean flag, SFunction<T, ?> function, Object val);



    default MyBatisPlusMax<T> lt(SFunction<T, ?> function, Object val) {
        return this.lt(null,function,val);
    }

    MyBatisPlusMax<T> lt(Boolean flag, SFunction<T, ?> function, Object val);

    default MyBatisPlusMax<T> notLike(SFunction<T,?> function, Object val) {
        return this.likeRight(function,val);
    }

    MyBatisPlusMax<T> notLike(Boolean condition, SFunction<T,?> function, Object val);
    default MyBatisPlusMax<T> le(SFunction<T, ?> function, Object val) {
        return this.le(null,function,val);
    }

    MyBatisPlusMax<T> le(Boolean flag, SFunction<T, ?> function, Object val);





    List<T> list() ;

     T one() ;

    long count();


     Page<T> page(Integer pageNo, Integer size) ;


}
